<?php


//form has been submitted
include '../connection.php';
if ( isset( $_GET['lang'] ) )
	$lang = $_GET['lang'];
else
	$lang = 'en';
	
include 'lang/lang_'.$lang.'.php';



?>
<?php
session_start();
ob_start();
if (!isset($_SESSION['loggedin'])) {

    header('Location: login.php');
}
?>

<?php include 'index.php';?>

<div id="body-wrapper">

    <div id="main-content">

        <div class="content-box">
		
		  <div class="content-box-header">

                <h3><?= Manage_Products ?></h3>

                <div class="clear"></div>

            </div> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" href="style_<?= $lang ?>.css" media="screen" type="text/css">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add new product</title>
</head>

<body>


<table style="width:100%" style="">

	 <thead>
                            <tr>
                                <th><label><?= name_en_lb ?></label></th>
                                <th ><label><?= desc_en_lb ?></label></th>
								<th ><label><?= status_lb  ?></label></th>
								<th ><label><?= category_lb ?></label></th>  
								<th ><label><?= img_lb ?></label></th>
								<th ><label><?= Visits_lb ?></label></th>
								<th ><label><?= edit_lb ?></label></th>
								<th ><label><?= delete_lb ?></label></th>
        

                            </tr>

     </thead>
    
    <?php 
	
		$query = "SELECT * FROM PRODUCTS";
		$res = mysql_query($query);
		while ( ( $row = mysql_fetch_array($res) ) != '' )
		{
	 ?>
	<tr>
    	
        <td ><label><?= $row['name_en'] ?></label></td>
        <td ><label><?= $row['desc_en'] ?></label></td>
        <td ><label><?= $row['status'] ?> </label></td>
        <td ><label><?= $row['category'] ?></label></td>  
		<td>   <img src="<?= '../photos/thumb/'.$row['img'] ?>" width="90px" height = "110px" /> </td>
        <td ><label><?= $row['visit_num'] ?></label></td>
        
        <td ><label><a href="addProduct.php?action=update&id=<?= $row['id'] ?>" ><img src="resources/images/icons/pencil.png" alt="Update" /></a></label></td>
        <td ><label><a href="addProduct.php?action=delete&id=<?= $row['id'] ?>" ><img src="resources/images/icons/cross.png"  alt="Delete"</a></label></td>

    </tr>
    
    <?php } ?>

</table>

</body>
</html>